﻿SeadragonJSButton = function(width, height, tileSize, tileOverlap, tilesUrl, fileFormat, displayRects) {
    /// <summary>Creates a DziTileSource for a Deep Zoom Image having tiles of the given format at the given URL. If the image is sparse, the image's display rectangles should be given as a list of Seadragon.DisplayRect instances.</summary>
    /// <param name="width"></param>
    /// <param name="height"></param>
    /// <param name="tileSize"></param>
    /// <param name="tileOverlap"></param>
    /// <param name="tilesUrl"></param>
    /// <param name="fileFormat">The file format used by this Deep Zoom Image.</param>
    /// <param name="displayRects" optional="true">If this image is sparse, the Seadragon.DisplayRect instances given to the constructor, otherwise null.</param>
    /// <field name="fileFormat" type="string">The file format used by this Deep Zoom Image.</field>
    /// <field name="displayRects" type="string">If this image is sparse, the Seadragon.DisplayRect instances given to the constructor, otherwise null.</field>
    /// <returns type="Object"></returns>
}

SeadragonJSButton.prototype =
{
    fileFormat: null,
    displayRects: null,

    getTileUrl: function(level, x, y) {
        /// <summary>Returns the URL for the given tile.</summary>
        /// <param name="level"></param>
        /// <param name="x"></param>
        /// <param name="y"></param>
        /// <returns type="string"></returns>
    },

    tileExists: function(level, x, y) {
        /// <summary>Returns true if the given tile exists and is part of the sparse image.</summary>
        /// <param name="level"></param>
        /// <param name="x"></param>
        /// <param name="y"></param>
        /// <returns type="boolean"></returns>
    }
}

SeadragonJSButton.createFromXml = function(xmlUrl, xmlString, callback) {
    /// <summary>Creates a new Seadragon.DziTileSource from the XML file at the given URL. If the contents of the XML are given, the XML is not actually downloaded; otherwise, it is. (The location of the XML is needed in either case to determine the location of the tiles.)</summary>
    /// <param name="xmlUrl">XML File to download.</param>
    /// <param name="xmlString">If specified the XML file is not downloaded.</param>
    /// <param name="callback">If a callback function is given, the XML is loaded/parsed asynchronously, and the Seadragon.DziTileSource is passed as the sole parameter to the callback upon completion. Otherwise, the XML is loaded/parsed synchronously and the Seadragon.DziTileSource is returned by this method. If the XML fails to load/parse and a callback function was given, null is passed to the callback along with an optional error message as a second parameter. If the XML fails to load/parse and no callback function was given, an error is thrown.</param>
}